# 设置NuGet.exe路径
$nugetPath = ".\nuget.exe"

# 设置NuGet源和API密钥
$source = "repo-lpkry"
$apiKey = ""

# 设置包含.nupkg文件的目录
$packagesDirectory = "nupkgs/"

# 获取目录中的所有.nupkg文件
$packages = Get-ChildItem -Path $packagesDirectory -Filter *.nupkg

foreach ($package in $packages) {
    Write-Output "& $nugetPath push -source $source $package"
    & $nugetPath push -source $source $package.FullName
    if ($LASTEXITCODE -eq 0) {
        Write-Output "Successfully pushed $($package.FullName)"
    } else {
        Write-Output "Failed to push $($package.FullName)"
    }
}
Write-Output "All NuGet packages pushed successfully!"
